<?php use_helper('I18N') ?>

<script type="text/javascript">
    $(function() {
        $(".editLink").button({
                    icons: {
                        primary: "ui-icon-circle-check"
                    }
                })
        $("#btnCreate").button({
                    icons: {
                        primary: "ui-icon-circle-plus"
                    }
                })
    });
</script>
<div style="padding: 10px; top: 10px; width: 98%">
    <div class="portlet" id="sf_admin_container">
        <div class="portlet-header">Member Order</div>
        <div class="portlet-content" id="sf_admin_content" style="width: 98%">
            <table class="sf_admin_list" width="100%">
                <thead>
                <tr>
                    <th>Order</th>
                    <th>Member</th>
                    <th>Delivery name</th>
                    <th>Delivery comment</th>
                    <th>Payment method</th>
                    <th>Payment comment</th>
                    <th>Sub amount</th>
                    <th>Delivery amount</th>
                    <th>Total amount</th>
                    <th>Address</th>
                    <th>Country</th>
                    <th>City</th>
                    <th>Address1</th>
                    <th>Address2</th>
                    <th>State</th>
                    <th>Postcode</th>
                    <th>Remarks</th>
                    <th>Status code</th>
                    <th>Created on</th>
                </tr>
                </thead>
                <tbody>
                <?php
                $className = "sf_admin_row_1";
                foreach ($cms_member_orders as $cms_member_order):
                    if ($className == "sf_admin_row_0") {
                        $className = "sf_admin_row_1";
                    } else {
                        $className = "sf_admin_row_0";
                    }
                    $member = CmsMemberPeer::retrieveByPK($cms_member_order->getMemberId());
                ?>
                <tr class="<?php echo $className?>">
                    <td><?php echo link_to("Edit", 'member/orderEdit?order_id=' . $cms_member_order->getOrderId(), array ('class' => 'editLink')) ?></td>
                    <td><?php echo link_to($member->getFullName(), 'member/memberEdit?member_id=' . $cms_member_order->getMemberId()) ?></td>
                    <td><?php echo $cms_member_order->getDeliveryName() ?></td>
                    <td><?php echo $cms_member_order->getDeliveryComment() ?></td>
                    <td><?php echo $cms_member_order->getPaymentMethod() ?></td>
                    <td><?php echo $cms_member_order->getPaymentComment() ?></td>
                    <td><?php echo $cms_member_order->getSubAmount() ?></td>
                    <td><?php echo $cms_member_order->getDeliveryAmount() ?></td>
                    <td><?php echo $cms_member_order->getTotalAmount() ?></td>
                    <td><?php echo $cms_member_order->getAddressId() ?></td>
                    <td><?php echo $cms_member_order->getCountry() ?></td>
                    <td><?php echo $cms_member_order->getCity() ?></td>
                    <td><?php echo $cms_member_order->getAddress1() ?></td>
                    <td><?php echo $cms_member_order->getAddress2() ?></td>
                    <td><?php echo $cms_member_order->getState() ?></td>
                    <td><?php echo $cms_member_order->getPostcode() ?></td>
                    <td><?php echo $cms_member_order->getRemarks() ?></td>
                    <td><?php echo $cms_member_order->getStatusCode() ?></td>
                    <td><?php echo $cms_member_order->getCreatedOn() ?></td>
                </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>

            <br>

            <div style="text-align: right">
                <?php echo link_to('create', 'settings/categoriesCreate', array("id" => "btnCreate")) ?>
            </div>

        </div>
    </div>
</div>
